﻿@if (Buttons != null && Buttons.Any())
{
    <div class="top-row">
        @foreach (var button in Buttons)
        {
            var model = button.ToViewModel();
            model.OnClick += async (sender, args) => await OnButtonClick.InvokeAsync(args);

            @button.ToRenderFragment(model);
        }
    </div>
}

@code {
    [Parameter] public IEnumerable<ButtonUI>? Buttons { get; set; }
    [Parameter] public EventCallback<ButtonClickEventArgs> OnButtonClick { get; set; }
}
